<?php

namespace app\admin\command;

use app\admin\model\Reserve;
use app\admin\model\Room;
use app\admin\model\User;
use app\common\library\Tongtongsuo;
use app\common\library\Yunding;
use Carbon\Carbon;
use fast\Http;
use fast\Random;
use think\console\Command;
use think\console\Input;
use think\console\input\Option;
use think\console\Output;
use think\Db;
use think\Env;
use think\Exception;
use think\Log;

class TestTongTong extends Command
{

    protected function configure()
    {
        $this->setName('testtongtong')
            ->setDescription('test tong tong api');
    }

    protected function execute(Input $input, Output $output)
    {
        @ini_set("memory_limit",'-1');
        $stime=microtime(true);

//
        echo Carbon::parse('2023-04-19 16:00:00')->getTimestampMs();
        echo PHP_EOL;
        echo Carbon::parse('2023-04-19 18:00:00')->getTimestampMs();
        echo PHP_EOL;
        echo Carbon::now()->getTimestampMs();

        echo PHP_EOL;
        echo md5(substr('15719438520', 5));


//        $lockId = '8573185';
//        $phone = '15196649231';
//        $startDate = '2023-04-20 17:00:00';
//        $endDate = '2023-04-20 17:30:00';
//
//        $tts = new Tongtongsuo();
//        $res = $tts->addPassword($lockId, $phone, $startDate, $endDate);
//        var_dump($res);
//        exit;



        echo PHP_EOL;
        $etime=microtime(true);//获取程序执行结束的时间
        $total=$etime-$stime;   //计算差值
        $output->writeln($total);
    }



}
